<template>
  <div>
    <el-card class="box-card">
      <template #header>
        <div class="card-header">
          <span>用户详情</span>
          <el-button style="float:  right" type="primary" @click="router.go(-1)"
            >返回</el-button
          >
        </div>
      </template>
      <!-- <el-form :model="userDetail">
        <el-form-item label="用户id:">
          {{ userDetail.id}}
        </el-form-item>
        <el-form-item label="微信昵称:">
          {{ userDetail.wechat_name }}
        </el-form-item>
        <el-form-item label="头像:">
          {{ userDetail.avatarurl }}
        </el-form-item>
        <el-form-item label="姓名:">
          {{ userDetail.name }}
        </el-form-item>
        <el-form-item label="手机:">
          {{ userDetail.phone }}
        </el-form-item>
        <el-form-item label="证件号:">
          {{ userDetail.identity_number }}
        </el-form-item>
        <el-form-item label="证件类型:">
          {{ userDetail.identity_type }}
        </el-form-item>
        <el-form-item label="创建时间:">
          {{ userDetail.created_at }}
        </el-form-item>
        <el-form-item label="更新时间:">
          {{ userDetail.updated_at }}
        </el-form-item>
      </el-form> -->
    </el-card>
  </div>
</template>

<script setup>
import { onBeforeMount, reactive, ref } from "vue";
import { useRouter, useRoute } from "vue-router";
import Api from "../../api/index";
const route = useRoute();
const router = useRouter();
const userDetail = ref();

onBeforeMount(() => {
  getDetail();
});

//获取详情
const getDetail = async () => {
  let id = route.query.id;
  if (id) {
    const res = await Api.getUserDetail(id);
    if(res.data.code == 0){
      userDetail.value = res.data.user_info
    }
  }
};
</script>

<style lang="scss" scoped></style>
